/**
 * @properties={typeid:35,uuid:"75CBE948-4FFC-42BE-B64B-F6B4E836DA9C",variableType:-4}
 */
var fCodBarras = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"5604FE1D-9950-4172-8540-6620660511E9"}
 */
var fNombreDoc = null;

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"C76CE737-0089-40F6-AC4D-E7D763625DCA"}
 */
function onShow(firstShow, event) {
	// inicialización de variables
	if (tipo_cbte == 1 || tipo_cbte == 6)
	{
		fNombreDoc = "Factura"
	}
	if (tipo_cbte == 2 || tipo_cbte == 7)
	{
		fNombreDoc = "Nota de Débito"
	}
	if (tipo_cbte == 3 || tipo_cbte == 8)
	{
		fNombreDoc = "Nota de Crédito"
	}
	//Esta hecho como ejemplo, no seria la version definitiva hasta no tener todos los datos bien
	elements.bean_cod_barra.visible = false
	elements.gCodBarras.visible = true
	globals.gCodigo_afip()
	//elements.bean_cod_barra.code = globals.gCod_final
	//globals.gCod_barras = plugins.images.getImage(elements.bean_cod_barra)//application.createJPGImage(elements.bean_cod_barra,elements.bean_cod_barra.getWidth(), elements.bean_cod_barra.getHeight());
}

/**
 * Called before the form component is rendered.
 *
 * @param {JSRenderEvent} event the render event
 *
 * @properties={typeid:24,uuid:"82DD21BC-6AB9-40A2-821B-878959D654BB"}
 */
function onRenderTelefono(event) {
	if (!gempresa_to_empresas.telefono)
	{
		event.getRenderable().visible = false
	}
	else
	{
		event.getRenderable().visible = true
	}
}

/**
 * Called before the form component is rendered.
 *
 * @param {JSRenderEvent} event the render event
 *
 * @properties={typeid:24,uuid:"5DB31B01-A22C-495D-85A7-60BB6D144E69"}
 */
function onRenderFax(event) {
	if (!gempresa_to_empresas.fax)
	{
		event.getRenderable().visible = false
	}
	else
	{
		event.getRenderable().visible = true
	}
}
